package com.mjk.common.ai.work.admin;

import com.mjk.common.ai.dto.KbEditReq;
import com.mjk.common.ai.dto.KbInfoResp;
import com.mjk.common.ai.dto.KbSearchReq;
import com.mjk.common.ai.service.KnowledgeBaseService;
import com.mjk.common.base.error.BeeError;
import com.mjk.common.base.response.BeeResponse;
import com.mjk.common.base.work.BaseWork;
import com.mjk.common.base.work.annotation.BeeWork;
import com.mjk.common.core.jdbc.bean.BeePage;
import jakarta.annotation.Resource;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@BeeWork(work = "kb")
public class AdminKbWork extends BaseWork {

    @Resource
    private KnowledgeBaseService knowledgeBaseService;

    public BeeResponse getKbList(KbSearchReq kbSearchReq) {
        return BeeError.BEE_SUC.tranceError(knowledgeBaseService.search(kbSearchReq, kbSearchReq.getPageStart(), kbSearchReq.getPageSize()));
    }

    public BeeResponse editKb(KbEditReq kbEditReq) {
        knowledgeBaseService.softDelete(kbEditReq.getUuid());
        return BeeError.BEE_SUC.tranceError();
    }

    public BeeResponse delKb(KbEditReq kbEditReq) {
        knowledgeBaseService.softDelete(kbEditReq.getUuid());
        return BeeError.BEE_SUC.tranceError();
    }

}
